<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
     <script type="text/javascript">
     	function Student(id,name){
     		this.id=id;
     		this.name=name;
     		this.sayHi=function(){console.log("hi")};
     	}
     	//利用原型给对象加方法
     	Student.prototype.introduce=function(){
     		console.log("Good Morning");
     	};
     	var s1=new Student(1,'zhangsan');
     	var s2=new Student(2,'lisi');
     	console.log(s1.sayHi==s2.sayHi);//false
     	console.log(s1.introduce==s2.introduce);//ture
     	
     	//构造对象：使用混合方式来构造对象：构造函数加属性：原型加方法
     </script>
	</body>
</html>
